/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface UserCollect extends BasicModel<UserCollect> {
  userCode?: string; // 用户编码
  userName?: string; // 用户名称
  projectCode?: string; // 项目编码
  projectName?: string; // 项目名称
  attention?: number; // 关注度
}

export const userCollectList = (params?: UserCollect | any) =>
  defHttp.get<UserCollect>({ url: adminPath + '/proj/collect/userCollect/list', params });

export const userCollectListData = (params?: UserCollect | any) =>
  defHttp.post<Page<UserCollect>>({
    url: adminPath + '/proj/collect/userCollect/listData',
    params,
  });

export const userCollectForm = (params?: UserCollect | any) =>
  defHttp.get<UserCollect>({ url: adminPath + '/proj/collect/userCollect/form', params });

export const userCollectSave = (params?: any, data?: UserCollect | any) =>
  defHttp.postJson<UserCollect>({
    url: adminPath + '/proj/collect/userCollect/save',
    params,
    data,
  });

export const userCollectDelete = (params?: UserCollect | any) =>
  defHttp.get<UserCollect>({ url: adminPath + '/proj/collect/userCollect/delete', params });

export const userCollectBatchDelete = (params?: UserCollect | any) =>
  defHttp.get<UserCollect>({ url: adminPath + '/proj/collect/userCollect/batchDelete', params });
